﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Nage.Examples.Rastrigin.Solution;

namespace Nage.Examples.RastriginIsland
{
    public class FixedGenerationsMigrationCondition : IMigrationCondition<Coordinates>
    {
        public Int32 StepNumber { get; set; }

        public FixedGenerationsMigrationCondition(int stepNum)
        {
            this.StepNumber = stepNum;
        }

        public bool ShouldMigrate(int generationNumber, Topologies.ITopology<Coordinates> topology)
        {
            return (generationNumber % this.StepNumber == 0);
        }
    }
}
